Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • estout stcox | bunching multiple univariate cox

    Hello all inlcuding Ben Jann:

    I am trying to export a table of 5 separate univariate cox with their HR, CI and p-values in three columns. I managed to get -eststo- and -estab- to do some of it. But I am having trouble going beyond this with getting just the three columns and -estout-. Can dataex if that would help.

    eststo clear
    local clltxvar anytxcll cllchem cllnov4 cllbtk cllbcl2
    foreach var of local clltxvar{
    eststo: qui stcox `var'
    }


    esttab, ci brackets wide nocons onecell label eform

    ------------------------------------------------------------------------------------------------------------------------
    (1) (2) (3) (4) (5)
    Analysis t~s Analysis time when r~s Analysis t~s Analysis time when r~s Analysis t~s
    ------------------------------------------------------------------------------------------------------------------------
    Untreated vs. Trea~L 2.947*** [1.843,4.714]
    Chemotherapy for C~s 1.945*** [1.341,2.820]
    Novel 4 (BTKi, BCL~K 1.767** [1.253,2.492]
    BTK inhibitors for~s 1.571* [1.108,2.229]
    BCL2-inhibitors fo~s 1.726** [1.144,2.603]
    ------------------------------------------------------------------------------------------------------------------------
    Observations 230 219 216 216 216
    ------------------------------------------------------------------------------------------------------------------------
    Exponentiated coefficients; 95% confidence intervals in brackets
    * p<0.05, ** p<0.01, *** p<0.001

  • #2
    Maybe the following helps: http://repec.sowi.unibe.ch/stata/estout/other.html#h-5
    Ben

    Comment


    • #3
      That helped!! I ran your program and added this to eststo.

      eststo clear
      eststo b1: quietly stcox cllbcl2 // Univariate with CLL BCL2 only
      eststo b2: quietly stcox cllbtk // Univariate with CLL BTK only
      eststo b3: quietly stcox rtbtk // Univariate with RT BTK only
      eststo b4: quietly stcox cllnov4 // Univariate with any novel agent
      eststo b5: quietly stcox cllfluda // Univariate with CLL Fludarabine
      eststo b6: quietly stcox anytxcll // Univariate with any CLL therapy
      eststo univar: appendmodels b1 b2 b3 b4 b5 b6
      esttab univar, mtitles

      estout univar using "./cox_reg.txt", replace ///
      eform varwidth(12) varlabels(_cons Constant) ///
      cells("b(star fmt(%12.3f)) ci(par fmt(%12.4f))") ///
      baselevels modelwidth(10 10 10) title("Testing univariates models") ///
      collabels("Predictor" "HR/CI") wrap label hlinechar("-") ///
      note("Univariate models")

      Comment

      Working...
      X